<?php
define("_needlogin", "0");
define("_access", "1");
include_once("include/db.config.php"); 
$sql = "SELECT team.`name`,`number`,`school`,member.name as MemberName from team,member 
        where team.captainID = member.student_id order by team.id asc";
$r = getAll($sql);

?>
<!DOCTYPE html>
<html>
<?php include("include/head.php"); ?>
<body>
<?php include("include/nav.php"); ?>

<link rel="stylesheet" type="text/css" href="/static/css/c3.min.css">

<div class="row">
    <br>
    <?php 
        if(!$r){
            echo "<center>暂时无队伍信息</center>";
            die();
        }else{
            echo "<h1>参赛队伍</h1>";
        }
    ?>
    <table id="teamsboard">
        <thead>
            <tr>
                <td><b>队名</b></td>
                <!--<td><b>成员</b></td>-->
                <td><b>队伍规模</b></td>
                <td><b>学校</b></td>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($r as $key => $value) { ?>
                <tr>
                    <td><span><?php echo $value['name'];?></span></td>
                    <!--<td><span><?php echo $value['MemberName'];?></span></td>-->
                    <td><span><?php echo $value['number'];?></span></td>
                    <td><span><?php echo $value['school'];?></span></td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
        
<?php include("include/script.php"); ?>
</body>
</html>